package solutions.leetcode.normal;

import solutions.lib.BaseSolution;

/**
 * @author lizhidong
 * <a href="https://leetcode.cn/problems/angle-between-hands-of-a-clock/">1344. 时钟指针的夹角</a>
 */
public class Solution1344 extends BaseSolution {

    public double angleClock(int hour, int minutes) {
        int angleMin = minutes * 6;
        double angleHour = hour * 30 + ((double) minutes) / 2;
        double an = (angleMin - angleHour + 360) % 360;
        return an <= 180 ? an : 360 - an;
    }

    public static void main(String[] args) {
        Solution1344 solution = new Solution1344();
        System.out.println(solution.angleClock(3, 15));
    }
}